import Http from '@/api/http';
import UserSyncStatus from '../structure/userSyncStatus';

const BASE_URL = 'wx/user/wx/mp/user';

/**
 * 微信公众号用户
 */
class WxMpUserApi extends Http {
    /**
     * 获取同步用户信息进度
     * @param appId 应用ID
     * @return 响应
     */
    public getUserSyncStatus(appId: string): Promise<UserSyncStatus> {
        return super.get0(`${BASE_URL}/${appId}/userSync`);
    }

    /**
     * 用户同步
     * @param appId 应用ID
     * @return 响应
     */
    public userSync(appId: string): Promise<void> {
        return super.post0(`${BASE_URL}/${appId}/userSync`);
    }
}

export default new WxMpUserApi();
